import request from '@/utils/request'
// import {useTokenStore} from '@/stores/thoken.js'
export const articleCategoryListService = () => {
    // const tokenStore = useTokenStore()
    // //获取token
    // const token = tokenStore.thoken
    return request.get("/category/list")
}


export const articleCategoryAddService = (categoryData) => {
    
    return request.post('/category/add', categoryData)

}

export const articleCategoryUpdateService = (categoryData) => {
    return request.put('/category/update', categoryData)
}

export const articleCategoryDeleteService = (categoryId) => {
    return request.delete('/category?id=' + categoryId)
}   


export const articleListService = (params) => {

    return request.get('/article', {params:params})

}

export const articleAddService= (articleData)=>{
    return request.post('/article/add', articleData)
}

export const articleUpdateService= (articleData)=>{
    return request.patch('/article/update', articleData)
}

export const articleDeleteService= (id)=>{
    return request.delete('/article/delete?id=' + id)
}